﻿using System;
using p = FinPlusAnalytics.QLConvParser;

namespace FinPlusAnalytics
{
    public class RepoTrade : Trade
    {
        public string Id { get; private set; }

        //construct
        public RepoTrade(string marketName, string cacheName, string id, string bondName, string repoCurveName, string bondCurveName, double strike, double nominal, DateTime settlementDate, DateTime deliveryDate, int settlementDays, string repoConv, string bondConv, string holidays)
        {
            Id = id;

            //just getting demos runnings thats all
            var market = Markets.Instance.GetMarket(marketName);
            var cache = Caches.Instance.GetCache(cacheName);
            var calendar = p.Calendar(holidays);

            //ql::FixedRateBondForward(marketName, id,  bondName, repoCurveName, bondCurveName, strike, settlementDate, deliveryDate, settlementDays, repoConv, bondConv, holidays);

            //boost::shared_ptr<QuantLib::Forward> fwdBnd = fwdBonds[marketName][id];
            //if(!fwdBnd) return "#unknown fwdbond";
            //QuantLib::FixedRateBondForward fwdBond = *dynamic_cast<QuantLib::FixedRateBondForward*> (fwdBnd.get());

            //boost::shared_ptr<QuantLib::Bond> bnd = bonds[marketName][bondName];
            //if(!bnd) return "#unknown bond";
            //QuantLib::FixedRateBond bond = *dynamic_cast<QuantLib::FixedRateBond*> (bnd.get());

            //caches[cacheName][id] = boost::shared_ptr<FixedRateBondForwardWrap>(new FixedRateBondForwardWrap(fwdBond, bond, settlementDate, deliveryDate, nominal/100, strike));

            //tradeEngineMap[cacheName][id] =  repoCurveName;

        }
    }
}
